<div>
	<?
		$id = isset($_REQUEST['id']) ? $_REQUEST['id'] : null;
		$history = isset($_REQUEST['history']) ? $_REQUEST['history'] : null;		
	?>
	<link href="css/form.css" rel="stylesheet" type="text/css" />

	<script type="text/javascript">
		$(function() {					
			$('#btnAdd').click(function(){
				$.ajax({
					url: "task/save.php",
					data: $('#formTask').serialize(),
					success: function(data){
						$('#id').val(data);
						alert(data);
					}
				});
				
				return false;
			});
		});	
	</script>

	<form id="formTask">
		<fieldset>
			<legend>Task</legend>
			<p>
				<input id="id" name="id" type="hidden" value="<?= $id?>" />
				<input id="history" name="history" type="hidden" value="<?= $history?>" />
				
				<label>Name:</label>
				<br />
				<input id="name" name="name" type="text" value="" />
			</p>		
			<p>
				<label>Allotted time:</label>
				<br />
				<input id="allottedTime" name="allottedTime" type="text" value="" />
			</p>
			<p>
				<label>Description:</label>
				<br />
				<textarea id="description" name="description" ></textarea>
			</p>
			<p>						
				<input id="task" name="type" type="radio" value="1" />
				<label for="task">Task</label>			
				<input id="bug" name="type" type="radio" value="2" />
				<label for="bug">Bug</label>			
				<input id="impediment" name="type" type="radio" value="3" />
				<label for="impediment">Impediment</label>
			</p>
			<input id="btnAdd" type="button" value="Add" />
		</fieldset>
	</form>
</div>